// 回顾C语言文件接口

#include<stdio.h>
#include<string.h>
#include<unistd.h>

int main()
{
    //int a = 12345;
    //char buffer[1024];
    //snprintf(buffer,sizeof(buffer),"%d",a);
    //write(1,buffer,strlen(buffer));
   // const char* m = "hello";
    //write(1,m,strlen(m));

//    // 向显示器打印内容的方法
//    printf("hello world\n");
//    fputs("aaaa",stdout);
//    fwrite("bbbb",1,4,stdout);
//    fprintf(stdout,"cccc");
//
    // 文件操作fopen
    //FILE* fp = fopen("log.txt","a");  //append 追加
    ////FILE* fp = fopen("log.txt","w");
    //if(fp == NULL)
    //{
    //    perror("fopen");
    //    return 1;
    //}
    //char buffer[1024];
    //const char* message = "hello file";
    //int i = 0;
    //while(i < 10)
    //{
    //    snprintf(buffer,sizeof(buffer),"%s:%d\n",message,i);
    //    fputs(buffer,fp);
    //    i++;
    //}
    //fclose(fp);
    return 0;
}
